package edu.yngsxy.communityservice.core.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 基础实体类，通常作为项目中所有数据库实体类（Entity）的父类，用于抽取公共属性或方法，实现代码复用
 */
@Data
public class WkBaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(title = "用户ID", description = "自动递增", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @TableId(type = IdType.AUTO)  // 主键自增
    private Integer id;
    @Schema(title = "添加时间", description = "添加时间", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @TableField("added_time")
    private LocalDateTime addedTime= LocalDateTime.now();
    @TableField("updated_time")
    @Schema(title = "修改日期", description = "修改日期", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private LocalDateTime updatedTime= LocalDateTime.now();
}
